set :repository, "http://tvienes.googlecode.com/svn/trunk/"

#ips
set :tvienes, '192.168.10.187'
set :branch, 'tvienes'

#roles
role :web, tvienes
role :app, tvienes
role :db, tvienes, :primary => true
role :ddf, 'soviet.the.com', :no_release => true

set :deploy_base, "/var/www"
set :deploy_to, "#{deploy_base}/#{branch}"
set :user,     'deploys'            # defaults to the currently logged in user
set :spinner_user,     'deploys'            # defaults to the currently logged in user
set :checkout, 'export'


task :before_restart, :except => { :no_release => true } do
  run "chmod +x  #{release_path}/script/process/reaper"
end


task :after_deploy do
  symlink_config
  symlink_files
end

task :symlink_config, :except => { :no_release => true }  do
  run "ln -nfs /etc/tvienes/database.yml #{release_path}/config/database.yml"
  run "ln -nfs /etc/tvienes/sms.yml #{release_path}/config/sms.yml"
  run "ln -nfs /etc/tvienes/mail.yml #{release_path}/config/mail.yml"
end


task :symlink_files,  :except => { :no_release => true }  do
  run "ln -nfs #{deploy_to}/shared/files #{release_path}/public/files"
end
